QuickTime 3 Reference

Previous | Chapter Top | Chapter Contents | Next

General Event

For events longer than two words, you use General event with a subtype. Figure 11 illustrates the contents of a General event.

Figure 11A note request General event

Table 7Contents of a General event

General event type

first nibble value = 1111

Part number

unique part identifier

Event length

head: number of words in event

Data words

depends on subtype

Subtype

8-bit unsigned subtype

Event length

tail: must be identical to head

Event tail

first nibble of last word = 11XX

The part number bit field contains a unique identifier that is later used to match Note, Knob, and Controller events to a specific part. For example, to play a note the application uses the part number to specify which instrument will play the note. The General event allows part numbers of up to 12 bits. The standard Note and Controller events allow part numbers of up to 5 bits; the Extended Note and Extended Controller events allow 12-bit part numbers.

The event length bit fields contained in the first and last words of the message are identical and are used as a message format check and to move back and forth through the message. The lengths include the head and tail; the smallest length is 2.

The data words field is a variable length field containing information unique to the subtype of the General event. The subtype bit field indicates the subtype of General event. There are nine subtypes:

Macro calls are used to stuff the General event's head and tail long words, but not the structures described above:

qtma_StuffGeneralEvent(w1, w2, instrument, subType, length)

Macros are used to extract field values from the event's head and tail long words.

qtma_XInstrument(m, l)
qtma_GeneralSubtype(m, l)
qtma_GeneralLength(m, l)

© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next